package com.gmq.chapter01.daemon;

/**
 * Created by gmq on 2017/08/11.
 * （我自己的理解）
 * thread线程是守护线程，守护main方法，main方法结束了，守护线程就结束了
 *
 * @version 1.0
 * @since 2017/08/11 14:00
 */
public class Run {

    public static void main(String[] args) {
        try {
            MyThread thread = new MyThread();
            thread.setDaemon(true);
            thread.start();
            Thread.sleep(6000);
            System.out.println("我离开thread对象也不在打印了，也就是停止了！");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
